package org.mulan.cloud2020demo.controllers;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * @author 韩志雄
 * @date 2021/4/16 22:16
 */
@RestController
@Slf4j
public class OrderController {
	public static final String PAYMENT_URL="http://cloud-payment-service";

	@Resource
	private RestTemplate restTemplate;

	@GetMapping("/payment/consul")
	public String info(){
		System.out.println("----------------");
		return restTemplate.getForObject(PAYMENT_URL+"/payment/consul",String.class);
	}
}
